<template>
  <div>
    <el-table :data="tableData">
      <el-table-column prop="imgUrl" label="商品主图"></el-table-column>
      <el-table-column prop="name" label="商品名"></el-table-column>
      <el-table-column prop="price" label="价格"></el-table-column>
      <el-table-column prop="supplyTime" label="上架时间"></el-table-column>
    </el-table>
  </div>
</template>


<script>
import request from "@/utils/request";

export default {
  name: "GoodsRecords",
  data() {
    return {
      userinfo: {},
      wantbuy: false,
      dialogFormVisible: false,
      tableData: [],
      tableDat: []
    }
  },
  created() {
    request.get("http://localhost:8081/seller/seehistoricalgoods").then(res => {
      this.tableData = res.data
      if (res.flag) {
        this.$message({
          type: 'success',
          message: res.msg
        })
      } else {
        this.$message.error(res.msg);
      }
    })
  },
  methods: {
    Showbuyer(row) {
      this.wantbuy = true
      request.get("http://localhost:8081/seller/intendingUSer?goods_id=" + row.goods.id).then(res => {
        if (res.flag) {
          this.tableDat = res.data;
          this.$message({
            type: 'success',
            message: res.msg
          })
        } else {
          this.$message.error(res.msg);
        }
      })

    }
  }

}
</script>

<style scoped>
.buttom1 {
  width: 40px;
  height: 20px;
  margin-left: 400px;
  background-color: blue;
}
</style>
